import request from '@/utils/request'
import qs from 'qs'


/**
 * 处理待办
 */
export function handleTodo(params) {
  return request({
    url: '/api/admin/projectProgress/handleTodo',
    method: 'get',
    params
  })
}

/**
 * 获得待办
 */
export function getTodo(params) {
  return request({
    url: '/api/admin/projectProgress/getTodo',
    method: 'get',
    params
  })
}

/**
 * 根据系统别查询列表
 */
export function queryBySystemType(query) {
  return request({
    url: '/api/admin/templateBlock/queryBySystemType',
    method: 'get',
    params: query
  })
}

/**
 * 保存工务追踪详情
 */
export function saveDetail(list) {
  return request({
    url: '/api/admin/projectProgress/save',
    method: 'post',
    data: list
  })
}

export function saveProjectStatusDetail(list) {
  return request({
    url: '/api/admin/projectProgress/saveProjectStatusDetail',
    method: 'post',
    data: list
  })
}

/**
 * 查询工务追踪详情
 */
export function queryDetail(query) {
  return request({
    url: '/api/admin/projectProgress/queryDetail',
    method: 'get',
    params: query
  })
}

/**
 * 查询专案编号
 * 入参名称：projectNo
 * 改成分页查询
 */
export function queryProject(query) {
  return request({
    url: '/api/admin/project/query',
    method: 'get',
    params: query
  })
}

/**
 * 查询客户简称
 * 入参名称：customerNo
 */
export function queryCustomer(query) {
  return request({
    url: '/api/admin/customer/queryClient',
    method: 'get',
    params: query
  })
}

/**
 * 查询员工
 * 入参名称：username
 */
export function getUserInfoList(code) {
  return request({
    url: '/api/admin/user/getUserInfoList?' + qs.stringify(code),
    method: 'get'
  })
}

/**
 * 查询员工
 * 入参名称：username
 */
export function getUserInfoByName(code) {
  return request({
    url: '/api/admin/user/getUserInfoByName',
    method: 'get',
    params: code
  })
}

/**
 * 查询厂商
 * 入参名称：vendorNo
 */
export function queryVendor(query) {
  return request({
    url: '/api/admin/vendor/queryList',
    method: 'get',
    params: query
  })
}

/**
 * 更新记录  customerNo
 */
export function selectByProgressId(query) {
  return request({
    url: '/api/admin/projectLog/selectByProgressId',
    method: 'get',
    params: query
  })
}

/**
 * 应收单号查询  oma01
 */
export function queryByExample(query) {
  return request({
    url: '/api/admin/erp/OmaFile/queryOmaFile',
    method: 'get',
    params: query
  })
}

/**
 * 根据ERP应收单号,获取ERP应收金额
 * @param query
 */
export function queryARMoney(query) {
  return request({
    url: '/api/admin/erp/OmaFile/queryARMoney',
    method: 'post',
    data: query
  })
}

/**
 * 应付单号查询  apa01
 */
export function queryApaFile(query) {
  return request({
    url: '/api/admin/erp/ApaFile/queryApaFile',
    method: 'get',
    params: query
  })
}

/**
 * 根据ERP应付单号,获取ERP付款金额
 * @param query
 */
export function queryAPMoney(query) {
  return request({
    url: '/api/admin/erp/ApaFile/queryAPMoney',
    method: 'post',
    data: query
  })
}

/**
 * 获得报价单号
 */
export function getOfferOrderByprojectNo(query) {
  return request({
    url: '/api/admin/myOffer/getOfferOrderByprojectNo',
    method: 'get',
    params: query
  })
}

/**
 * 获得存单编号的流水号
 */
export function getBdOrder(query) {
  return request({
    url: '/api/admin/projectProgress/getBdOrder',
    method: 'get',
    params: query
  })
}

/**
 * 获取厂商PO单号和厂商简称
 * 入参名称：progressId
 */
export function getVendorPoNoAndNameByProgressId(query) {
  return request({
    url: '/api/admin/projectVendor/getVendorPoNoAndNameByProgressId',
    method: 'get',
    params: query
  })
}


